define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'shop/auth/index' + location.search,
                    add_url: 'shop/auth/add',
                    edit_url: 'shop/auth/edit',
                    del_url: 'shop/auth/del',
                    multi_url: 'shop/auth/multi',
                    import_url: 'shop/auth/import',
                    table: 'wanlshop_auth',
                }
            });

            var table = $("#table");
            $(".btn-add").data("area", ["100%", "100%"]);

            //当内容渲染完成给编辑按钮添加`data-area`属性
            table.on('post-body.bs.table', function (e, settings, json, xhr) {
                    $(".btn-editone").data("area", ["100%", "100%"]);
             });

            Fast.config.openArea = ['90%','90%'];
            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                fixedColumns: true,
                fixedRightNumber: 1,
                searchFormVisible: true,
                columns: [
                    [
                        {checkbox: true},
                       // {field: 'id', title: __('Id')},
                       // {field: 'user_id', title: __('User_id')},
                        {field: 'shop_code', title: __('Shop_code'), operate: 'LIKE'},
                        {field: 'state', title: __('State'), searchList: {"1":__('State 1'),"2":__('State 2')}, formatter: Table.api.formatter.normal},
                        {field: 'shopname', title: __('Shopname'), operate: 'LIKE'},
                        {field: 'name', title: __('Name'), operate: false},
                        {field: 'phone', title: __('Phone'), operate: false},
                        {field: 'city', title: __('City'), operate: 'LIKE'},
                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'publictime', title: __('Publictime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'orizationtime', title: __('Orizationtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'verify', title: __('Verify'), searchList: {"0":__('Verify 0'),"3":__('Verify 3')}, formatter: Table.api.formatter.normal},
                        {field: 'staff.name', title: __('Staff_id'), operate: false},

                        
                    //    {field: 'payment', title: __('Payment'), searchList: {"0":__('Payment 0'),"1":__('Payment 1')}, formatter: Table.api.formatter.normal},
                    //    {field: 'receipt', title: __('Receipt'), searchList: {"0":__('Receipt 0'),"1":__('Receipt 1')}, formatter: Table.api.formatter.normal},
                    //    {field: 'receipimages', title: __('Receipimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'quota', title: __('Quota')},
                    //    {field: 'firstloan', title: __('Firstloan'), operate:'BETWEEN'},
                    //    {field: 'systemcost', title: __('Systemcost'), operate:'BETWEEN'},
                    //    {field: 'deposit', title: __('Deposit'), operate:'BETWEEN'},
                    //    {field: 'total', title: __('Total'), operate:'BETWEEN'},
                    //    {field: 'channel', title: __('Channel'), operate: 'LIKE'},
                    //    {field: 'channelimages', title: __('Channelimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'document', title: __('Document'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                    //    {field: 'areaadd', title: __('Areaadd'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                    //    {field: 'individual', title: __('Individual'), searchList: {"0":__('Individual 0'),"1":__('Individual 1')}, formatter: Table.api.formatter.normal},
                    //    {field: 'individualimages', title: __('Individualimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'contractimages', title: __('Contractimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'contracttime', title: __('Contracttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                    //    {field: 'business', title: __('Business'), operate: 'LIKE'},
                    //    {field: 'businessadd', title: __('Businessadd'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                    //    {field: 'businessimages', title: __('Businessimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'corporatename', title: __('Corporatename'), operate: 'LIKE'},
                    //    {field: 'identity', title: __('Identity'), operate: 'LIKE'},
                    //    {field: 'identityimages', title: __('Identityimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'telephone', title: __('Telephone'), operate: 'LIKE'},
                    //    {field: 'service_ids', title: __('Service_ids'), operate: 'LIKE'},
                    //    {field: 'authorization', title: __('Authorization'), searchList: {"0":__('Authorization 0'),"1":__('Authorization 1')}, formatter: Table.api.formatter.normal},
                    //    {field: 'authorizationtime', title: __('Authorizationtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                    //    {field: 'authorizationimages', title: __('Authorizationimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'operation', title: __('Operation'), searchList: {"0":__('Operation 0'),"1":__('Operation 1')}, formatter: Table.api.formatter.normal},
                       
                    //    {field: 'operationadd', title: __('Operationadd'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                    //    {field: 'guarantee', title: __('Guarantee'), searchList: {"0":__('Guarantee 0'),"1":__('Guarantee 1')}, formatter: Table.api.formatter.normal},
                    //    {field: 'publiccontract', title: __('Publiccontract'), searchList: {"0":__('Publiccontract 0'),"1":__('Publiccontract 1')}, formatter: Table.api.formatter.normal},
                    //    
                    //    {field: 'publicthandimages', title: __('Publicthandimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'publictimages', title: __('Publictimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'otherimages', title: __('Otherimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'shopimages', title: __('Shopimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'orization', title: __('Orization'), searchList: {"0":__('Orization 0'),"1":__('Orization 1')}, formatter: Table.api.formatter.normal},
                    //    
                    //    {field: 'orizationimages', title: __('Orizationimages'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
                    //    {field: 'shopgroup_ids', title: __('Shopgroup_ids'), operate: 'LIKE'},
                    //   
                    //    {field: 'remark', title: __('Remark'), operate: 'LIKE'},
                    //    {field: 'number', title: __('Number'), operate: 'LIKE'},
                    //    {field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
                    //    {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                    //    {field: 'trademark', title: __('Trademark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                    //    {field: 'wechat', title: __('Wechat'), operate: 'LIKE'},
                    //    {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
                    //    {field: 'bio', title: __('Bio'), operate: 'LIKE'},
                    //    {field: 'refuse', title: __('Refuse'), operate: 'LIKE'},
                    //   
                    //   
                    //    
                    //    {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                    //    {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status},
                        {field: 'operate', title: __('Operate'), table: table,
                            buttons: [{
                                name: "test",
                                text: "查看/编辑",//按钮名称
                                classname: 'btn btn-xs btn-success btn-magic ',
                                // classname: 'btn btn-xs btn-success btn-magic btn-dialog',
                                icon: 'fa fa-magic',
                                url: 'shop/auth/detail',//指向控制器对应方法
                                confirm: '查看/编辑息',
                                visible: function (row) {
                                    //返回true时按钮显示,返回false隐藏
                                    return true;
                                }
                            }], events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        recyclebin: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    'dragsort_url': ''
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: 'shop/auth/recyclebin' + location.search,
                pk: 'id',
                sortName: 'id',
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: __('Id')},
                        {field: 'name', title: __('Name'), align: 'left'},
                        {
                            field: 'deletetime',
                            title: __('Deletetime'),
                            operate: 'RANGE',
                            addclass: 'datetimerange',
                            formatter: Table.api.formatter.datetime
                        },
                        {
                            field: 'operate',
                            width: '140px',
                            title: __('Operate'),
                            table: table,
                            events: Table.api.events.operate,
                            buttons: [
                                {
                                    name: 'Restore',
                                    text: __('Restore'),
                                    classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
                                    icon: 'fa fa-rotate-left',
                                    url: 'shop/auth/restore',
                                    refresh: true
                                },
                                {
                                    name: 'Destroy',
                                    text: __('Destroy'),
                                    classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
                                    icon: 'fa fa-times',
                                    url: 'shop/auth/destroy',
                                    refresh: true
                                }
                            ],
                            formatter: Table.api.formatter.operate
                        }
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
        },

        add: function () {
            Controller.api.bindevent();
            $("input:radio[name='row[state]']").change(function (){
                let val = $("input:radio[name='row[state]']:checked").val()
                if (val === '2'){
                    $(".store").show();
                    $(".service").hide();
                }else{
                    $(".store").hide();
                    $(".service").show();
                }

            });

        },
        detail: function () {
            var auth_id = $('#auth').html();
            $(document).on("focus", ".auth-edit", function () {
                Backend.api.open('shop/auth/edit/ids/' + auth_id, __('Detail'));
            });
            $(document).on("click", ".information-edit", function () {
                Backend.api.open('shop/auth/information/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".finance-edit", function () {
                Backend.api.open('shop/auth/finance/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".finance-detail", function () {
                Backend.api.open('shop/auth/finance/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".selection-edit", function () {
                Backend.api.open('shop/auth/selection/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".design-edit", function () {
                Backend.api.open('shop/auth/design/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".goods-edit", function () {
                Backend.api.open('shop/auth/goods/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".supply-edit", function () {
                Backend.api.open('shop/auth/supply/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".train-edit", function () {
                Backend.api.open('shop/auth/train/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".activity-edit", function () {
                Backend.api.open('shop/auth/activity/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".business-edit", function () {
                Backend.api.open('shop/auth/business/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("click", ".accredit-edit", function () {
                Backend.api.open('shop/auth/accredit/ids/' + auth_id,'审核',{area: ['100%', '100%']});
            });
            $(document).on("focus", ".check-edit", function () {
                var type = $(this).data('type'); //
                var ids = $(this).data('ids');
                layer.open({
                    id:1,
                    type: 1,
                    title:'完成时效',
                    skin:'layui-layer-rim',
                    area:['450px', 'auto'],
                    // closeBtn :1,//右上角的关闭按钮取消
                    content: ' <div class="row" style="width: 420px;  margin-left:7px; margin-top:10px;">'
                        +'<div class="col-sm-12">'
                        +'<div class="input-group">'
                        +'<span class="input-group-addon">完成时效时间   :</span>'
                        +'<input id="timess" type="number" class="form-control" placeholder="请输入完成时效时间" value="0">'
                        +'</div>'
                        +'</div>'
                        +'<span style="text-align: center;margin-left:20px;">输入1 则为1小时 </span>'
                        +'</div>'
                    ,
                    btn:['保存'],
                    btn1: function (index,layero) {
                        var timess = $('#timess').val();

                        if (timess <= 0) {
                            layer.msg('请填写完成时效', {time: 1500, anim: 6});
                            return false;
                        }
                        Fast.api.ajax({
                            url: 'shop/auth/check',
                            data: {time: timess,id:ids,type:type},
                        }, function (data) {
                            Toastr.success("操作成功");
                            window.location.reload();
                            layer.close(index);
                            return false;
                        }, function () {
                            Toastr.error("操作失败");
                            return false;
                        });
                    }
                });

            });
        },
        edit: function () {
            Controller.api.bindevent();
            $(document).ready(function (){
                let val = $("input:radio[name='row[state]']:checked").val()
                if (val === '2'){
                    $(".store").show();
                    $(".service").hide();
                }else{
                    $(".store").hide();
                    $(".service").show();
                }
            })
            $("input:radio[name='row[state]']").change(function (){
                let val = $("input:radio[name='row[state]']:checked").val()
                if (val === '2'){
                    $(".store").show();
                    $(".service").hide();
                }else{
                    $(".store").hide();
                    $(".service").show();
                }

            });
        },
        reject: function (){
            Controller.api.bindevent();
            $(document).on("click", ".reject", function (e) {
                e.preventDefault();
                var type = $(this).data('type'); //
                var ids = $(this).data('ids');
                var url = '';

                var reason = $('#c-reason').val();
                var receipimages = $('#c-receipimages').val();
                if (type == 'information'){
                    url = 'shop/auth/reject/ids/'+ids+'/type/' + type;
                }else if (type == 'finance'){
                    url = 'shop/auth/reject/ids/'+ids+'/type/' + type;
                }
                    Fast.api.ajax({
                        url:url,
                        data: {reason:reason,receipimages:receipimages},
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        window.parent.location.reload();
                        Toastr.error("操作失败");
                        return false;
                    });

            });

        },
        information: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var formData = $(this).serialize();

                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/information/ids/'+ids+'/status/' + status,
                        data: formData
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/information','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        finance: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var formData = $(this).serialize();

                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/finance/ids/'+ids+'/status/' + status,
                        data: formData
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/finance','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        selection: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var formData = $(this).serialize();

                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/selection/ids/'+ids+'/status/' + status,
                        data: formData
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/selection','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        design: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var formData = $('#edit-form').serializeArray();
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/design/ids/'+ids+'/status/' + status,
                        data: formData
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/design','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        goods: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var order = $('#c-order').val();
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/goods/ids/'+ids+'/status/' + status,
                        data: {order:order}
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/goods','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        supply: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var tracking = $('#c-tracking').val();
                var supply = $('#c-supply').val()
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/supply/ids/'+ids+'/status/' + status,
                        data: {supply:supply,tracking:tracking}
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/supply','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        train: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var traintime = $('#c-traintime').val()
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/train/ids/'+ids+'/status/' + status,
                        data: {traintime:traintime}
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/train','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        activity: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/activity/ids/'+ids+'/status/' + status,
                        data: {}
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/activity','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        business: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                var starttime = $('#c-starttime').val()
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/business/ids/'+ids+'/status/' + status,
                        data: {starttime:starttime}
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/business','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        accredit: function () {
            $(document).on("click", ".success", function (e) {
                e.preventDefault();
                var status = $(this).data('status'); //
                var ids = $(this).data('ids');
                if (status === 1){
                    Fast.api.ajax({
                        url:'shop/auth/accredit/ids/'+ids+'/status/' + status,
                        data: {}
                    }, function (data) {
                        Toastr.success("操作成功");
                        window.parent.location.reload();
                        return false;
                    }, function () {
                        Toastr.error("操作失败");
                        return false;
                    });
                }
                if (status === 0){
                    var layerIndex = parent.layer.getFrameIndex(window.name); // 获取当前iframe层的索引
                    parent.layer.close(layerIndex);
                    // 跳转 到输入驳回原因
                    parent.Backend.api.open('shop/auth/reject/ids/' + ids +'/type/accredit','驳回',{area: ['100%', '100%']});
                }
            });
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});
